#include"process.h"
#define times 1000*20
#define load_capcity 1024*1024
#define load_size 1024*10
void download(fun cp)  //回调函数，传入指针函数
{
  int nums=200;
  int total=0;
  while(total<=load_capcity)
  {
    usleep(times);
    double rate=100.0*total/(load_capcity);
    
    cp(rate);
    total+=load_size;
    if(total>(load_capcity)/2&&nums)
    {
      nums--;
      total=load_capcity/2;
    }
  }
  cp(100.0);
  printf("\n");
}


int main()
{
  download(function_2);
}
